% ........................ Model Driven Engineering
% ........................ Metamodeling
% ,,,,,,,,,,,,,,,,,,,,,,,, MOF
Our work addresses an issue typical of the \emph{Model-Driven Engineering} practices, which is the use of models as the most important artifact to design and specify solutions. From this arises the problem of searching models stored in repositories, that is also the main topic of this thesis. 

One of the currently most active branch of Model Driven Engineering is \emph{Model-Driven Development} (MDD). This approach allows developers to use models to specify what system functionalities are required and what architecture is to be used instead of requiring them to use a programming language to specify how a system is implemented \cite{Atkinson:2003:MDM:942589.942704}. Code can be generated from the models, ranging from systems skeletons to complete, deployable products. MDD focuses the efforts of software development on the design phase with a greater attention to system architecture.

\emph{Model-Driven Architecture} (MDA) is a set of standards proposed by \emph{Object Management Group} (OMG) that support the architecture-focused approach of MDD. The standards include a language to write metamodels called the \emph{Meta Object Facility} (MOF).

\emph{Metamodeling}, a natural consequence of MDD, is the construction of a collection of ``concepts'' useful for modeling a predefined class of problems. This section introduces the fundamental aspects of metamodeling.

A model is a simplified representation of a certain reality, according to the rules of a certain modeling language. As the map represents a territory and conforms to its legend, the \emph{conformance relationship} says that a model represents a system and conforms to a metamodel \cite{bezivin:on}. In Figure~\ref{fig:metamodel_model_system} you can see a picture showing this concept.
\begin{figure}[ht]
  \begin{center}
	\includegraphics[width=0.5\textwidth]{./pictures/metamodel_model_system}
	\caption{Conformance relationship: a model represents a system and conforms to a metamodel.}
	\label{fig:metamodel_model_system}
  \end{center}
\end{figure}

According to OMG standards, a metamodel is a special kind of model that specifies the abstract syntax of a modeling language. The abstract syntax of a language describes the vocabulary of concepts provided by the language and how they may be combined to create models. It consists of a definition of the concepts, the relationships that exists between concepts and how the concepts may be legally combined.

Figure~\ref{fig:four_modeling_layers} illustrates the traditional four layer infrastructure.
\begin{figure}[ht]
  \begin{center}
	\includegraphics[width=0.8\textwidth]{./pictures/four_modeling_layers}
	\caption{Traditional OMG's metamodeling infrastructure with four layers.}
	\label{fig:four_modeling_layers}
  \end{center}
\end{figure}
This infrastructure consists of a hierarchy of model levels, each (except the top model) being characterized as ``an instance'' of the level above. Starting from the bottom of the hierarchy, the M0 layer is the real \emph{system}. A \emph{model} represents this system at level M1. This model conforms to its \emph{metamodel} defined at level M2. The metamodel itself conforms to the \emph{meta-metamodel} at level M3. The meta-metamodel conforms to itself. An example of a level M2 is the WebML metamodel, the model that describes WebML itself. M2-models describe elements of the M1-layer, and thus M1-models. These would be, for example, models written in WebML. The last layer includes real data and real world objects. UML is a special case because it can be used for describing itself, so it can be used both as a model and as a metamodel.

In language specifications the abstract syntax of the language is specified as a MOF-compliant metamodel. MOF provides the standard modeling and interchange constructs used in MDA. These constructs are a subset of UML modeling constructs, essentially the Class Diagram subset of UML: object attributes, relationships between objects, operations available on objects and simple constraints (e.g., multiplicity). The Eclipse Modeling Framework Project (EMF) includes Ecore, a MOF-like core metamodel.

EMF provides a pluggable framework to store model information, the default uses XMI (XML Metadata Interchange) to persists the model definition. XMI defines an XML-based exchange format for models of M3, M2 and M1 layer and is also the supporting standard of MOF. The typical usage scenario of the metamodeling practices within a system design project and development would be: metamodel specification, model instance generation from the previously created metamodel, generation of Java code for a model, refinement.

As mentioned, the increasing use of metamodeling and MDD brings up the problem of searching an already designed solution. In the following chapter we propose an abstract solution for our Model Driven Information Retrieval System and we discuss our implementation experience in which we used two different datasets. The first one is a dataset of models expressed in a general-purpose modeling language, UML, and the second one is expressed in a domain-specific modeling language, WebML.
